//
//  HDCustomComponent.h
//  HDecoration
//
//  Created by koki on 15-4-24.
//  Copyright (c) 2015年 HDecoration. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSObject (PerformBlockAfterDelay)
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay;
@end

@interface UIColor (HexStringToColor)

+(UIColor *)hexStringToColor:(NSString *)stringToConvert;
+(UIColor *)skBackgroundColor;
+(UIColor *)skThemeColor;

@end

@interface UIView (UIViewFrame)
@property(nonatomic) CGFloat left;
@property(nonatomic) CGFloat top;
@property(nonatomic, readonly) CGFloat right;
@property(nonatomic, readonly) CGFloat bottom;
@property(nonatomic) CGFloat width;
@property(nonatomic) CGFloat height;
@end


@class DOImageView;
@protocol DOImageViewDelegate <NSObject>
- (void)doImageViewLoad:(DOImageView*)imgView img:(UIImage*)img;
@end

@interface DOImageView : UIImageView
@property (nonatomic,strong)UIColor* actIndicatorColor;
@property (nonatomic,copy)NSString* defaultImg;
@property(nonatomic,copy,setter=setImgURLStr:)NSString* imgURLStr;
@property(nonatomic,assign,setter=setImgData:)NSData* imgData;
@property(nonatomic,weak)id<DOImageViewDelegate>delegate;
@property(nonatomic,assign)BOOL needCache;

+(NSData *)inquiryImageCache:(NSString *)imageUrl;
+(void)savaImageData:(NSData *)imageData forUrl:(NSString *)imageUrl;
+(BOOL)localExistFile:(NSString*)filename;
+(void)setImgUrl:(NSString *)strValue imgView:(UIImageView*)imgView;
@end


@interface GXButton : UIButton
@property(nonatomic,assign)BOOL relayout;
@property(nonatomic,assign)CGRect imageViewFrame;
@property(nonatomic,assign)CGRect titleLabelFrame;
@property(nonatomic,copy)NSObject* object;
@property(nonatomic,assign)CGPoint point;
@property (nonatomic,assign) int  numberCount;
@property (nonatomic,assign) BOOL enableTip;
@property(nonatomic,assign)BOOL showTip;
-(void)playCountAnimation;
@end



@protocol GXScrollToolBarDelegate <NSObject>
- (void)scrollToolBarBtnAction:(GXButton*)sender toolBar:(id)toolBar;
- (void)scrollToolBarBtnRepeat;
@end

@interface GXScrollToolBar : UIView
{
    UIScrollView*  _scrollContainer;
    UIButton* curSeletedBtn;
    NSMutableArray *items;
}
@property(nonatomic,strong)UIButton* curSeletedBtn;
@property(nonatomic,weak)id<GXScrollToolBarDelegate> delegate;
@property(nonatomic,strong)DOImageView* bgImageView;
@property(nonatomic,copy,setter=setDataArray:)NSArray* dataArray;

- (id)initWithFrame:(CGRect)frame;
-(void)TransferResponse:(GXButton*)sender;
-(void)setDefaultSelectedIndex:(int)index;
-(GXButton*)getBtnIndex:(int)index;
-(void)initItems;
@end


@interface SXProgressHUD : UIView
+(void) hideAllHUDsForView:(UIView*)view animated:(BOOL)animated;
+(void) showHUDAddedTo:(UIView*)view animated:(BOOL)animated;
@end

@interface SXTextView : UITextView
@property(nonatomic,copy)NSString *placehoder;
@end



@interface SXNavigation : NSObject
{
    UIViewController* rootViewCtr;
    int index;
    NSMutableArray* viewStack;
}
-(void)pushViewController:(UIViewController*)_viewCtr animated:(BOOL)animated;
-(void)popViewControllerAnimated:(BOOL)animated;
-(void)popToRootViewControllerAnimated:(BOOL)animated;
-(void)initWithRootViewController:(UIViewController*)_viewCtr;
-(void)clearData;
@property(nonatomic,assign)BOOL isToRootViewController;
+(SXNavigation*)shareNavigation;
@end



@interface GXLevelControl : UIView
{
    NSMutableArray *items;
}
@property (nonatomic,assign,setter=setLevelNum:)  int levelNum;
@property (nonatomic,assign,setter=setLevelTotal:) int levelTotal ;
@property (nonatomic,strong)NSString* selectedImgUrl;
@property (nonatomic,strong)NSString* normalImgUrl;
@end



@interface DOMarkView : UIView
@property(nonatomic,strong)NSString* title;
@property(nonatomic,strong)NSArray* marks;
@property(nonatomic,strong)NSString* selected;
@property(nonatomic,assign)BOOL isSingle;
@property(nonatomic,assign)BOOL showLine;
@property(nonatomic,strong)UIButton* curBtn;
-(void)cleanSelected;
@end



@interface HDAccountInput : UIView
@property(nonatomic,assign)int  value;
@end

@interface HDTextField : UITextField
- (id)initWithFrame:(CGRect)frame icon:(NSString *)icon title:(NSString *)title;
- (id)initWithFrame:(CGRect)frame isRightAngle:(BOOL)isRightAngle;
@end

@protocol HDDatePickerDelegate <NSObject>
- (void)datePickerPickDone:(NSDate *)date;
@end
@interface HDDatePickerView : UIView
//@property(nonatomic,strong)UIDatePicker *datePicker;
@property(nonatomic,weak)id<HDDatePickerDelegate>delegate;
@property(nonatomic,assign)UIDatePickerMode datePickerMode;
- (void)show;
@end

@interface HDTipView : UIView
+(void)showTipWithMsg:(NSString*)msg imgIcon:(NSString*)iconUrl hudView:(UIView*)hudView;
@end

@interface CDatePickerViewEx : UIPickerView <UIPickerViewDelegate, UIPickerViewDataSource>
@property (nonatomic, strong, readonly) NSDate *date;
-(void)selectToday;
@end

















